{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import linora as la\n",
    "label = [1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1]\n",
    "label_prob = [0.8, 0.4, 0.2, 0.5, 0.9, 0.2, 0.8, 0.6, 0.1, 0.3, 0.8, 0.3, 0.9, 0.2, 0.84, \n",
    "              0.2, 0.5, 0.23, 0.83, 0.71, 0.34, 0.3, 0.2, 0.7, 0.2, 0.8, 0.3, 0.59, 0.26, 0.16, 0.13, 0.8]\n",
    "label_pred = list(map(lambda x:round(x), label_prob))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': '/nbextensions/echarts/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"637144416da54e01b187ac1e3c5efab7\" style=\"width:800px;height:400px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts'], function(echarts) {\n",
       "        \n",
       "var myChart_637144416da54e01b187ac1e3c5efab7 = echarts.init(document.getElementById('637144416da54e01b187ac1e3c5efab7'), 'light', {renderer: 'canvas'});\n",
       "\n",
       "var option_637144416da54e01b187ac1e3c5efab7 = {\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Confusion Matrix Map\",\n",
       "            \"left\": \"auto\",\n",
       "            \"top\": \"auto\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"95%\",\n",
       "        \"top\": \"center\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"save as image\"\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"restore\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"data view\"\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"series_id\": 3867351,\n",
       "    \"tooltip\": {\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"heatmap\",\n",
       "            \"name\": \"Confusion Matrix\",\n",
       "            \"data\": [\n",
       "                [\n",
       "                    0.0,\n",
       "                    0.0,\n",
       "                    11.0\n",
       "                ],\n",
       "                [\n",
       "                    0.0,\n",
       "                    1.0,\n",
       "                    4.0\n",
       "                ],\n",
       "                [\n",
       "                    1.0,\n",
       "                    0.0,\n",
       "                    8.0\n",
       "                ],\n",
       "                [\n",
       "                    1.0,\n",
       "                    1.0,\n",
       "                    9.0\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"seriesId\": 3867351\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"Confusion Matrix\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": true,\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"top\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"animation\": true,\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"name\": \"Actual\",\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"category\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": false\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                0.0,\n",
       "                1.0\n",
       "            ],\n",
       "            \"splitArea\": {\n",
       "                \"show\": true\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"name\": \"Predict\",\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"category\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": true\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"formatter\": \"{value} \",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                0.0,\n",
       "                1.0\n",
       "            ],\n",
       "            \"splitArea\": {\n",
       "                \"show\": true\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\",\n",
       "        \"#f6f5ec\"\n",
       "    ],\n",
       "    \"visualMap\": {\n",
       "        \"type\": \"continuous\",\n",
       "        \"min\": 0,\n",
       "        \"max\": 11.0,\n",
       "        \"text\": [\n",
       "            \"high\",\n",
       "            \"low\"\n",
       "        ],\n",
       "        \"textStyle\": {\n",
       "            \"color\": \"#000\"\n",
       "        },\n",
       "        \"inRange\": {\n",
       "            \"color\": [\n",
       "                \"#50a3ba\",\n",
       "                \"#eac763\",\n",
       "                \"#d94e5d\"\n",
       "            ]\n",
       "        },\n",
       "        \"calculable\": true,\n",
       "        \"splitNumber\": 5,\n",
       "        \"orient\": \"horizontal\",\n",
       "        \"left\": \"left\",\n",
       "        \"top\": \"bottom\",\n",
       "        \"showLabel\": true\n",
       "    }\n",
       "};\n",
       "myChart_637144416da54e01b187ac1e3c5efab7.setOption(option_637144416da54e01b187ac1e3c5efab7);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.charts.heatmap.HeatMap at 0x1c10257d630>"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "la.chart.confusion_matrix_map(label, label_pred)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': '/nbextensions/echarts/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"ae224de65c8d42e99520a47e968734a1\" style=\"width:800px;height:400px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts'], function(echarts) {\n",
       "        \n",
       "var myChart_ae224de65c8d42e99520a47e968734a1 = echarts.init(document.getElementById('ae224de65c8d42e99520a47e968734a1'), 'light', {renderer: 'canvas'});\n",
       "\n",
       "var option_ae224de65c8d42e99520a47e968734a1 = {\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Gain Curve\",\n",
       "            \"left\": \"auto\",\n",
       "            \"top\": \"auto\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"95%\",\n",
       "        \"top\": \"center\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"save as image\"\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"restore\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"data view\"\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"series_id\": 8409915,\n",
       "    \"tooltip\": {\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"Gain\",\n",
       "            \"symbol\": \"emptyCircle\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"smooth\": true,\n",
       "            \"step\": false,\n",
       "            \"showSymbol\": true,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    0.03,\n",
       "                    1.0\n",
       "                ],\n",
       "                [\n",
       "                    0.06,\n",
       "                    1.0\n",
       "                ],\n",
       "                [\n",
       "                    0.09,\n",
       "                    1.0\n",
       "                ],\n",
       "                [\n",
       "                    0.12,\n",
       "                    1.0\n",
       "                ],\n",
       "                [\n",
       "                    0.16,\n",
       "                    1.0\n",
       "                ],\n",
       "                [\n",
       "                    0.19,\n",
       "                    1.0\n",
       "                ],\n",
       "                [\n",
       "                    0.22,\n",
       "                    1.0\n",
       "                ],\n",
       "                [\n",
       "                    0.25,\n",
       "                    0.875\n",
       "                ],\n",
       "                [\n",
       "                    0.28,\n",
       "                    0.7778\n",
       "                ],\n",
       "                [\n",
       "                    0.31,\n",
       "                    0.7\n",
       "                ],\n",
       "                [\n",
       "                    0.34,\n",
       "                    0.7273\n",
       "                ],\n",
       "                [\n",
       "                    0.38,\n",
       "                    0.6667\n",
       "                ],\n",
       "                [\n",
       "                    0.41,\n",
       "                    0.6923\n",
       "                ],\n",
       "                [\n",
       "                    0.44,\n",
       "                    0.6429\n",
       "                ],\n",
       "                [\n",
       "                    0.47,\n",
       "                    0.6\n",
       "                ],\n",
       "                [\n",
       "                    0.5,\n",
       "                    0.5625\n",
       "                ],\n",
       "                [\n",
       "                    0.53,\n",
       "                    0.5882\n",
       "                ],\n",
       "                [\n",
       "                    0.56,\n",
       "                    0.6111\n",
       "                ],\n",
       "                [\n",
       "                    0.59,\n",
       "                    0.5789\n",
       "                ],\n",
       "                [\n",
       "                    0.62,\n",
       "                    0.55\n",
       "                ],\n",
       "                [\n",
       "                    0.66,\n",
       "                    0.5238\n",
       "                ],\n",
       "                [\n",
       "                    0.69,\n",
       "                    0.5455\n",
       "                ],\n",
       "                [\n",
       "                    0.72,\n",
       "                    0.5217\n",
       "                ],\n",
       "                [\n",
       "                    0.75,\n",
       "                    0.5417\n",
       "                ],\n",
       "                [\n",
       "                    0.78,\n",
       "                    0.56\n",
       "                ],\n",
       "                [\n",
       "                    0.81,\n",
       "                    0.5769\n",
       "                ],\n",
       "                [\n",
       "                    0.84,\n",
       "                    0.5926\n",
       "                ],\n",
       "                [\n",
       "                    0.88,\n",
       "                    0.5714\n",
       "                ],\n",
       "                [\n",
       "                    0.91,\n",
       "                    0.5517\n",
       "                ],\n",
       "                [\n",
       "                    0.94,\n",
       "                    0.5333\n",
       "                ],\n",
       "                [\n",
       "                    0.97,\n",
       "                    0.5484\n",
       "                ],\n",
       "                [\n",
       "                    1.0,\n",
       "                    0.5312\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 8409915\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"Gain\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": true,\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"top\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"animation\": true,\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"value\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": false\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                0.03,\n",
       "                0.06,\n",
       "                0.09,\n",
       "                0.12,\n",
       "                0.16,\n",
       "                0.19,\n",
       "                0.22,\n",
       "                0.25,\n",
       "                0.28,\n",
       "                0.31,\n",
       "                0.34,\n",
       "                0.38,\n",
       "                0.41,\n",
       "                0.44,\n",
       "                0.47,\n",
       "                0.5,\n",
       "                0.53,\n",
       "                0.56,\n",
       "                0.59,\n",
       "                0.62,\n",
       "                0.66,\n",
       "                0.69,\n",
       "                0.72,\n",
       "                0.75,\n",
       "                0.78,\n",
       "                0.81,\n",
       "                0.84,\n",
       "                0.88,\n",
       "                0.91,\n",
       "                0.94,\n",
       "                0.97,\n",
       "                1.0\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"value\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": true\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"formatter\": \"{value} \",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\",\n",
       "        \"#f6f5ec\"\n",
       "    ]\n",
       "};\n",
       "myChart_ae224de65c8d42e99520a47e968734a1.setOption(option_ae224de65c8d42e99520a47e968734a1);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.charts.line.Line at 0x1c102fd06a0>"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "la.chart.gain_curve(label, label_prob)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': '/nbextensions/echarts/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"724ce8c431f740dca5ef9c891fa4b797\" style=\"width:800px;height:400px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts'], function(echarts) {\n",
       "        \n",
       "var myChart_724ce8c431f740dca5ef9c891fa4b797 = echarts.init(document.getElementById('724ce8c431f740dca5ef9c891fa4b797'), 'light', {renderer: 'canvas'});\n",
       "\n",
       "var option_724ce8c431f740dca5ef9c891fa4b797 = {\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Gini Curve\",\n",
       "            \"left\": \"auto\",\n",
       "            \"top\": \"auto\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"95%\",\n",
       "        \"top\": \"center\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"save as image\"\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"restore\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"data view\"\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"series_id\": 4830422,\n",
       "    \"tooltip\": {\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"Random\",\n",
       "            \"symbol\": \"emptyCircle\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"smooth\": true,\n",
       "            \"step\": false,\n",
       "            \"showSymbol\": true,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    0,\n",
       "                    0\n",
       "                ],\n",
       "                [\n",
       "                    0.03,\n",
       "                    0.03\n",
       "                ],\n",
       "                [\n",
       "                    0.06,\n",
       "                    0.06\n",
       "                ],\n",
       "                [\n",
       "                    0.09,\n",
       "                    0.09\n",
       "                ],\n",
       "                [\n",
       "                    0.12,\n",
       "                    0.12\n",
       "                ],\n",
       "                [\n",
       "                    0.16,\n",
       "                    0.16\n",
       "                ],\n",
       "                [\n",
       "                    0.19,\n",
       "                    0.19\n",
       "                ],\n",
       "                [\n",
       "                    0.22,\n",
       "                    0.22\n",
       "                ],\n",
       "                [\n",
       "                    0.25,\n",
       "                    0.25\n",
       "                ],\n",
       "                [\n",
       "                    0.28,\n",
       "                    0.28\n",
       "                ],\n",
       "                [\n",
       "                    0.31,\n",
       "                    0.31\n",
       "                ],\n",
       "                [\n",
       "                    0.34,\n",
       "                    0.34\n",
       "                ],\n",
       "                [\n",
       "                    0.38,\n",
       "                    0.38\n",
       "                ],\n",
       "                [\n",
       "                    0.41,\n",
       "                    0.41\n",
       "                ],\n",
       "                [\n",
       "                    0.44,\n",
       "                    0.44\n",
       "                ],\n",
       "                [\n",
       "                    0.47,\n",
       "                    0.47\n",
       "                ],\n",
       "                [\n",
       "                    0.5,\n",
       "                    0.5\n",
       "                ],\n",
       "                [\n",
       "                    0.53,\n",
       "                    0.53\n",
       "                ],\n",
       "                [\n",
       "                    0.56,\n",
       "                    0.56\n",
       "                ],\n",
       "                [\n",
       "                    0.59,\n",
       "                    0.59\n",
       "                ],\n",
       "                [\n",
       "                    0.62,\n",
       "                    0.62\n",
       "                ],\n",
       "                [\n",
       "                    0.66,\n",
       "                    0.66\n",
       "                ],\n",
       "                [\n",
       "                    0.69,\n",
       "                    0.69\n",
       "                ],\n",
       "                [\n",
       "                    0.72,\n",
       "                    0.72\n",
       "                ],\n",
       "                [\n",
       "                    0.75,\n",
       "                    0.75\n",
       "                ],\n",
       "                [\n",
       "                    0.78,\n",
       "                    0.78\n",
       "                ],\n",
       "                [\n",
       "                    0.81,\n",
       "                    0.81\n",
       "                ],\n",
       "                [\n",
       "                    0.84,\n",
       "                    0.84\n",
       "                ],\n",
       "                [\n",
       "                    0.88,\n",
       "                    0.88\n",
       "                ],\n",
       "                [\n",
       "                    0.91,\n",
       "                    0.91\n",
       "                ],\n",
       "                [\n",
       "                    0.94,\n",
       "                    0.94\n",
       "                ],\n",
       "                [\n",
       "                    0.97,\n",
       "                    0.97\n",
       "                ],\n",
       "                [\n",
       "                    1.0,\n",
       "                    1.0\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0.4\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 4830422\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"Gini\",\n",
       "            \"symbol\": \"emptyCircle\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"smooth\": true,\n",
       "            \"step\": false,\n",
       "            \"showSymbol\": true,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    0,\n",
       "                    0\n",
       "                ],\n",
       "                [\n",
       "                    0.03,\n",
       "                    0.0\n",
       "                ],\n",
       "                [\n",
       "                    0.06,\n",
       "                    0.0588\n",
       "                ],\n",
       "                [\n",
       "                    0.09,\n",
       "                    0.0588\n",
       "                ],\n",
       "                [\n",
       "                    0.12,\n",
       "                    0.0588\n",
       "                ],\n",
       "                [\n",
       "                    0.16,\n",
       "                    0.0588\n",
       "                ],\n",
       "                [\n",
       "                    0.19,\n",
       "                    0.1176\n",
       "                ],\n",
       "                [\n",
       "                    0.22,\n",
       "                    0.1765\n",
       "                ],\n",
       "                [\n",
       "                    0.25,\n",
       "                    0.2353\n",
       "                ],\n",
       "                [\n",
       "                    0.28,\n",
       "                    0.2941\n",
       "                ],\n",
       "                [\n",
       "                    0.31,\n",
       "                    0.2941\n",
       "                ],\n",
       "                [\n",
       "                    0.34,\n",
       "                    0.3529\n",
       "                ],\n",
       "                [\n",
       "                    0.38,\n",
       "                    0.3529\n",
       "                ],\n",
       "                [\n",
       "                    0.41,\n",
       "                    0.3529\n",
       "                ],\n",
       "                [\n",
       "                    0.44,\n",
       "                    0.3529\n",
       "                ],\n",
       "                [\n",
       "                    0.47,\n",
       "                    0.4118\n",
       "                ],\n",
       "                [\n",
       "                    0.5,\n",
       "                    0.4706\n",
       "                ],\n",
       "                [\n",
       "                    0.53,\n",
       "                    0.4706\n",
       "                ],\n",
       "                [\n",
       "                    0.56,\n",
       "                    0.4706\n",
       "                ],\n",
       "                [\n",
       "                    0.59,\n",
       "                    0.4706\n",
       "                ],\n",
       "                [\n",
       "                    0.62,\n",
       "                    0.5294\n",
       "                ],\n",
       "                [\n",
       "                    0.66,\n",
       "                    0.5294\n",
       "                ],\n",
       "                [\n",
       "                    0.69,\n",
       "                    0.5882\n",
       "                ],\n",
       "                [\n",
       "                    0.72,\n",
       "                    0.5882\n",
       "                ],\n",
       "                [\n",
       "                    0.75,\n",
       "                    0.5882\n",
       "                ],\n",
       "                [\n",
       "                    0.78,\n",
       "                    0.5882\n",
       "                ],\n",
       "                [\n",
       "                    0.81,\n",
       "                    0.6471\n",
       "                ],\n",
       "                [\n",
       "                    0.84,\n",
       "                    0.7059\n",
       "                ],\n",
       "                [\n",
       "                    0.88,\n",
       "                    0.7647\n",
       "                ],\n",
       "                [\n",
       "                    0.91,\n",
       "                    0.8235\n",
       "                ],\n",
       "                [\n",
       "                    0.94,\n",
       "                    0.8824\n",
       "                ],\n",
       "                [\n",
       "                    0.97,\n",
       "                    0.9412\n",
       "                ],\n",
       "                [\n",
       "                    1.0,\n",
       "                    1.0\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0.4\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 4830422\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"Random\",\n",
       "                \"Gini\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": true,\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"top\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"animation\": true,\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"value\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": false\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                0,\n",
       "                0.03,\n",
       "                0.06,\n",
       "                0.09,\n",
       "                0.12,\n",
       "                0.16,\n",
       "                0.19,\n",
       "                0.22,\n",
       "                0.25,\n",
       "                0.28,\n",
       "                0.31,\n",
       "                0.34,\n",
       "                0.38,\n",
       "                0.41,\n",
       "                0.44,\n",
       "                0.47,\n",
       "                0.5,\n",
       "                0.53,\n",
       "                0.56,\n",
       "                0.59,\n",
       "                0.62,\n",
       "                0.66,\n",
       "                0.69,\n",
       "                0.72,\n",
       "                0.75,\n",
       "                0.78,\n",
       "                0.81,\n",
       "                0.84,\n",
       "                0.88,\n",
       "                0.91,\n",
       "                0.94,\n",
       "                0.97,\n",
       "                1.0\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"value\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": true\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"formatter\": \"{value} \",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\",\n",
       "        \"#f6f5ec\"\n",
       "    ]\n",
       "};\n",
       "myChart_724ce8c431f740dca5ef9c891fa4b797.setOption(option_724ce8c431f740dca5ef9c891fa4b797);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.charts.line.Line at 0x1c1145450b8>"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "la.chart.gini_curve(label, label_prob)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': '/nbextensions/echarts/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"0ec7631510f440e4aec369c074f7a22e\" style=\"width:800px;height:400px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts'], function(echarts) {\n",
       "        \n",
       "var myChart_0ec7631510f440e4aec369c074f7a22e = echarts.init(document.getElementById('0ec7631510f440e4aec369c074f7a22e'), 'light', {renderer: 'canvas'});\n",
       "\n",
       "var option_0ec7631510f440e4aec369c074f7a22e = {\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Kolmogorov-Smirnov Curve\",\n",
       "            \"left\": \"auto\",\n",
       "            \"top\": \"auto\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"95%\",\n",
       "        \"top\": \"center\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"save as image\"\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"restore\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"data view\"\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"series_id\": 8212284,\n",
       "    \"tooltip\": {\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"TPR\",\n",
       "            \"symbol\": \"emptyCircle\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"smooth\": true,\n",
       "            \"step\": false,\n",
       "            \"showSymbol\": true,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    0,\n",
       "                    0\n",
       "                ],\n",
       "                [\n",
       "                    0.03,\n",
       "                    0.0588\n",
       "                ],\n",
       "                [\n",
       "                    0.06,\n",
       "                    0.1176\n",
       "                ],\n",
       "                [\n",
       "                    0.09,\n",
       "                    0.1765\n",
       "                ],\n",
       "                [\n",
       "                    0.12,\n",
       "                    0.2353\n",
       "                ],\n",
       "                [\n",
       "                    0.16,\n",
       "                    0.2941\n",
       "                ],\n",
       "                [\n",
       "                    0.19,\n",
       "                    0.3529\n",
       "                ],\n",
       "                [\n",
       "                    0.22,\n",
       "                    0.4118\n",
       "                ],\n",
       "                [\n",
       "                    0.25,\n",
       "                    0.4118\n",
       "                ],\n",
       "                [\n",
       "                    0.28,\n",
       "                    0.4118\n",
       "                ],\n",
       "                [\n",
       "                    0.31,\n",
       "                    0.4118\n",
       "                ],\n",
       "                [\n",
       "                    0.34,\n",
       "                    0.4706\n",
       "                ],\n",
       "                [\n",
       "                    0.38,\n",
       "                    0.4706\n",
       "                ],\n",
       "                [\n",
       "                    0.41,\n",
       "                    0.5294\n",
       "                ],\n",
       "                [\n",
       "                    0.44,\n",
       "                    0.5294\n",
       "                ],\n",
       "                [\n",
       "                    0.47,\n",
       "                    0.5294\n",
       "                ],\n",
       "                [\n",
       "                    0.5,\n",
       "                    0.5294\n",
       "                ],\n",
       "                [\n",
       "                    0.53,\n",
       "                    0.5882\n",
       "                ],\n",
       "                [\n",
       "                    0.56,\n",
       "                    0.6471\n",
       "                ],\n",
       "                [\n",
       "                    0.59,\n",
       "                    0.6471\n",
       "                ],\n",
       "                [\n",
       "                    0.62,\n",
       "                    0.6471\n",
       "                ],\n",
       "                [\n",
       "                    0.66,\n",
       "                    0.6471\n",
       "                ],\n",
       "                [\n",
       "                    0.69,\n",
       "                    0.7059\n",
       "                ],\n",
       "                [\n",
       "                    0.72,\n",
       "                    0.7059\n",
       "                ],\n",
       "                [\n",
       "                    0.75,\n",
       "                    0.7647\n",
       "                ],\n",
       "                [\n",
       "                    0.78,\n",
       "                    0.8235\n",
       "                ],\n",
       "                [\n",
       "                    0.81,\n",
       "                    0.8824\n",
       "                ],\n",
       "                [\n",
       "                    0.84,\n",
       "                    0.9412\n",
       "                ],\n",
       "                [\n",
       "                    0.88,\n",
       "                    0.9412\n",
       "                ],\n",
       "                [\n",
       "                    0.91,\n",
       "                    0.9412\n",
       "                ],\n",
       "                [\n",
       "                    0.94,\n",
       "                    0.9412\n",
       "                ],\n",
       "                [\n",
       "                    0.97,\n",
       "                    1.0\n",
       "                ],\n",
       "                [\n",
       "                    1.0,\n",
       "                    1.0\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 8212284\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"FPR\",\n",
       "            \"symbol\": \"emptyCircle\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"smooth\": true,\n",
       "            \"step\": false,\n",
       "            \"showSymbol\": true,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    0,\n",
       "                    0\n",
       "                ],\n",
       "                [\n",
       "                    0.03,\n",
       "                    0.0\n",
       "                ],\n",
       "                [\n",
       "                    0.06,\n",
       "                    0.0\n",
       "                ],\n",
       "                [\n",
       "                    0.09,\n",
       "                    0.0\n",
       "                ],\n",
       "                [\n",
       "                    0.12,\n",
       "                    0.0\n",
       "                ],\n",
       "                [\n",
       "                    0.16,\n",
       "                    0.0\n",
       "                ],\n",
       "                [\n",
       "                    0.19,\n",
       "                    0.0\n",
       "                ],\n",
       "                [\n",
       "                    0.22,\n",
       "                    0.0\n",
       "                ],\n",
       "                [\n",
       "                    0.25,\n",
       "                    0.0667\n",
       "                ],\n",
       "                [\n",
       "                    0.28,\n",
       "                    0.1333\n",
       "                ],\n",
       "                [\n",
       "                    0.31,\n",
       "                    0.2\n",
       "                ],\n",
       "                [\n",
       "                    0.34,\n",
       "                    0.2\n",
       "                ],\n",
       "                [\n",
       "                    0.38,\n",
       "                    0.2667\n",
       "                ],\n",
       "                [\n",
       "                    0.41,\n",
       "                    0.2667\n",
       "                ],\n",
       "                [\n",
       "                    0.44,\n",
       "                    0.3333\n",
       "                ],\n",
       "                [\n",
       "                    0.47,\n",
       "                    0.4\n",
       "                ],\n",
       "                [\n",
       "                    0.5,\n",
       "                    0.4667\n",
       "                ],\n",
       "                [\n",
       "                    0.53,\n",
       "                    0.4667\n",
       "                ],\n",
       "                [\n",
       "                    0.56,\n",
       "                    0.4667\n",
       "                ],\n",
       "                [\n",
       "                    0.59,\n",
       "                    0.5333\n",
       "                ],\n",
       "                [\n",
       "                    0.62,\n",
       "                    0.6\n",
       "                ],\n",
       "                [\n",
       "                    0.66,\n",
       "                    0.6667\n",
       "                ],\n",
       "                [\n",
       "                    0.69,\n",
       "                    0.6667\n",
       "                ],\n",
       "                [\n",
       "                    0.72,\n",
       "                    0.7333\n",
       "                ],\n",
       "                [\n",
       "                    0.75,\n",
       "                    0.7333\n",
       "                ],\n",
       "                [\n",
       "                    0.78,\n",
       "                    0.7333\n",
       "                ],\n",
       "                [\n",
       "                    0.81,\n",
       "                    0.7333\n",
       "                ],\n",
       "                [\n",
       "                    0.84,\n",
       "                    0.7333\n",
       "                ],\n",
       "                [\n",
       "                    0.88,\n",
       "                    0.8\n",
       "                ],\n",
       "                [\n",
       "                    0.91,\n",
       "                    0.8667\n",
       "                ],\n",
       "                [\n",
       "                    0.94,\n",
       "                    0.9333\n",
       "                ],\n",
       "                [\n",
       "                    0.97,\n",
       "                    0.9333\n",
       "                ],\n",
       "                [\n",
       "                    1.0,\n",
       "                    1.0\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 8212284\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"KS\",\n",
       "            \"symbol\": \"emptyCircle\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"smooth\": true,\n",
       "            \"step\": false,\n",
       "            \"showSymbol\": true,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    0,\n",
       "                    0\n",
       "                ],\n",
       "                [\n",
       "                    0.03,\n",
       "                    0.0588\n",
       "                ],\n",
       "                [\n",
       "                    0.06,\n",
       "                    0.1176\n",
       "                ],\n",
       "                [\n",
       "                    0.09,\n",
       "                    0.1765\n",
       "                ],\n",
       "                [\n",
       "                    0.12,\n",
       "                    0.2353\n",
       "                ],\n",
       "                [\n",
       "                    0.16,\n",
       "                    0.2941\n",
       "                ],\n",
       "                [\n",
       "                    0.19,\n",
       "                    0.3529\n",
       "                ],\n",
       "                [\n",
       "                    0.22,\n",
       "                    0.4118\n",
       "                ],\n",
       "                [\n",
       "                    0.25,\n",
       "                    0.3451\n",
       "                ],\n",
       "                [\n",
       "                    0.28,\n",
       "                    0.2784\n",
       "                ],\n",
       "                [\n",
       "                    0.31,\n",
       "                    0.2118\n",
       "                ],\n",
       "                [\n",
       "                    0.34,\n",
       "                    0.2706\n",
       "                ],\n",
       "                [\n",
       "                    0.38,\n",
       "                    0.2039\n",
       "                ],\n",
       "                [\n",
       "                    0.41,\n",
       "                    0.2627\n",
       "                ],\n",
       "                [\n",
       "                    0.44,\n",
       "                    0.1961\n",
       "                ],\n",
       "                [\n",
       "                    0.47,\n",
       "                    0.1294\n",
       "                ],\n",
       "                [\n",
       "                    0.5,\n",
       "                    0.0627\n",
       "                ],\n",
       "                [\n",
       "                    0.53,\n",
       "                    0.1216\n",
       "                ],\n",
       "                [\n",
       "                    0.56,\n",
       "                    0.1804\n",
       "                ],\n",
       "                [\n",
       "                    0.59,\n",
       "                    0.1137\n",
       "                ],\n",
       "                [\n",
       "                    0.62,\n",
       "                    0.0471\n",
       "                ],\n",
       "                [\n",
       "                    0.66,\n",
       "                    0.0196\n",
       "                ],\n",
       "                [\n",
       "                    0.69,\n",
       "                    0.0392\n",
       "                ],\n",
       "                [\n",
       "                    0.72,\n",
       "                    0.0275\n",
       "                ],\n",
       "                [\n",
       "                    0.75,\n",
       "                    0.0314\n",
       "                ],\n",
       "                [\n",
       "                    0.78,\n",
       "                    0.0902\n",
       "                ],\n",
       "                [\n",
       "                    0.81,\n",
       "                    0.149\n",
       "                ],\n",
       "                [\n",
       "                    0.84,\n",
       "                    0.2078\n",
       "                ],\n",
       "                [\n",
       "                    0.88,\n",
       "                    0.1412\n",
       "                ],\n",
       "                [\n",
       "                    0.91,\n",
       "                    0.0745\n",
       "                ],\n",
       "                [\n",
       "                    0.94,\n",
       "                    0.0078\n",
       "                ],\n",
       "                [\n",
       "                    0.97,\n",
       "                    0.0667\n",
       "                ],\n",
       "                [\n",
       "                    1.0,\n",
       "                    0.0\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": [\n",
       "                    {\n",
       "                        \"type\": \"max\",\n",
       "                        \"name\": \"Maximum\",\n",
       "                        \"symbol\": \"pin\",\n",
       "                        \"symbolSize\": 50,\n",
       "                        \"label\": {\n",
       "                            \"normal\": {\n",
       "                                \"textStyle\": {\n",
       "                                    \"color\": \"#fff\"\n",
       "                                }\n",
       "                            }\n",
       "                        }\n",
       "                    }\n",
       "                ]\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 8212284\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"TPR\",\n",
       "                \"FPR\",\n",
       "                \"KS\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": true,\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"top\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"animation\": true,\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"value\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": false\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                0,\n",
       "                0.03,\n",
       "                0.06,\n",
       "                0.09,\n",
       "                0.12,\n",
       "                0.16,\n",
       "                0.19,\n",
       "                0.22,\n",
       "                0.25,\n",
       "                0.28,\n",
       "                0.31,\n",
       "                0.34,\n",
       "                0.38,\n",
       "                0.41,\n",
       "                0.44,\n",
       "                0.47,\n",
       "                0.5,\n",
       "                0.53,\n",
       "                0.56,\n",
       "                0.59,\n",
       "                0.62,\n",
       "                0.66,\n",
       "                0.69,\n",
       "                0.72,\n",
       "                0.75,\n",
       "                0.78,\n",
       "                0.81,\n",
       "                0.84,\n",
       "                0.88,\n",
       "                0.91,\n",
       "                0.94,\n",
       "                0.97,\n",
       "                1.0\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"value\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": true\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"formatter\": \"{value} \",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\",\n",
       "        \"#f6f5ec\"\n",
       "    ]\n",
       "};\n",
       "myChart_0ec7631510f440e4aec369c074f7a22e.setOption(option_0ec7631510f440e4aec369c074f7a22e);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.charts.line.Line at 0x1c114545780>"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "la.chart.ks_curve(label, label_prob)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': '/nbextensions/echarts/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"197dc6efd9a24e72b4b6fc4db7c0afc3\" style=\"width:800px;height:400px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts'], function(echarts) {\n",
       "        \n",
       "var myChart_197dc6efd9a24e72b4b6fc4db7c0afc3 = echarts.init(document.getElementById('197dc6efd9a24e72b4b6fc4db7c0afc3'), 'light', {renderer: 'canvas'});\n",
       "\n",
       "var option_197dc6efd9a24e72b4b6fc4db7c0afc3 = {\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Lift Curve\",\n",
       "            \"left\": \"auto\",\n",
       "            \"top\": \"auto\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"95%\",\n",
       "        \"top\": \"center\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"save as image\"\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"restore\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"data view\"\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"series_id\": 4025589,\n",
       "    \"tooltip\": {\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"Lift\",\n",
       "            \"symbol\": \"emptyCircle\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"smooth\": true,\n",
       "            \"step\": false,\n",
       "            \"showSymbol\": true,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    0.03,\n",
       "                    1.882\n",
       "                ],\n",
       "                [\n",
       "                    0.06,\n",
       "                    1.882\n",
       "                ],\n",
       "                [\n",
       "                    0.09,\n",
       "                    1.882\n",
       "                ],\n",
       "                [\n",
       "                    0.12,\n",
       "                    1.882\n",
       "                ],\n",
       "                [\n",
       "                    0.16,\n",
       "                    1.882\n",
       "                ],\n",
       "                [\n",
       "                    0.19,\n",
       "                    1.882\n",
       "                ],\n",
       "                [\n",
       "                    0.22,\n",
       "                    1.882\n",
       "                ],\n",
       "                [\n",
       "                    0.25,\n",
       "                    1.647\n",
       "                ],\n",
       "                [\n",
       "                    0.28,\n",
       "                    1.464\n",
       "                ],\n",
       "                [\n",
       "                    0.31,\n",
       "                    1.318\n",
       "                ],\n",
       "                [\n",
       "                    0.34,\n",
       "                    1.369\n",
       "                ],\n",
       "                [\n",
       "                    0.38,\n",
       "                    1.255\n",
       "                ],\n",
       "                [\n",
       "                    0.41,\n",
       "                    1.303\n",
       "                ],\n",
       "                [\n",
       "                    0.44,\n",
       "                    1.21\n",
       "                ],\n",
       "                [\n",
       "                    0.47,\n",
       "                    1.129\n",
       "                ],\n",
       "                [\n",
       "                    0.5,\n",
       "                    1.059\n",
       "                ],\n",
       "                [\n",
       "                    0.53,\n",
       "                    1.107\n",
       "                ],\n",
       "                [\n",
       "                    0.56,\n",
       "                    1.15\n",
       "                ],\n",
       "                [\n",
       "                    0.59,\n",
       "                    1.09\n",
       "                ],\n",
       "                [\n",
       "                    0.62,\n",
       "                    1.035\n",
       "                ],\n",
       "                [\n",
       "                    0.66,\n",
       "                    0.986\n",
       "                ],\n",
       "                [\n",
       "                    0.69,\n",
       "                    1.027\n",
       "                ],\n",
       "                [\n",
       "                    0.72,\n",
       "                    0.982\n",
       "                ],\n",
       "                [\n",
       "                    0.75,\n",
       "                    1.02\n",
       "                ],\n",
       "                [\n",
       "                    0.78,\n",
       "                    1.054\n",
       "                ],\n",
       "                [\n",
       "                    0.81,\n",
       "                    1.086\n",
       "                ],\n",
       "                [\n",
       "                    0.84,\n",
       "                    1.115\n",
       "                ],\n",
       "                [\n",
       "                    0.88,\n",
       "                    1.076\n",
       "                ],\n",
       "                [\n",
       "                    0.91,\n",
       "                    1.039\n",
       "                ],\n",
       "                [\n",
       "                    0.94,\n",
       "                    1.004\n",
       "                ],\n",
       "                [\n",
       "                    0.97,\n",
       "                    1.032\n",
       "                ],\n",
       "                [\n",
       "                    1.0,\n",
       "                    1.0\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 4025589\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"Random\",\n",
       "            \"symbol\": \"emptyCircle\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"smooth\": true,\n",
       "            \"step\": false,\n",
       "            \"showSymbol\": true,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    0.03,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    0.06,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    0.09,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    0.12,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    0.16,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    0.19,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    0.22,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    0.25,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    0.28,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    0.31,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    0.34,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    0.38,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    0.41,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    0.44,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    0.47,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    0.5,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    0.53,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    0.56,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    0.59,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    0.62,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    0.66,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    0.69,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    0.72,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    0.75,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    0.78,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    0.81,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    0.84,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    0.88,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    0.91,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    0.94,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    0.97,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    1.0,\n",
       "                    1\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 4025589\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"Lift\",\n",
       "                \"Random\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": true,\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"top\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"animation\": true,\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"value\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": false\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                0.03,\n",
       "                0.06,\n",
       "                0.09,\n",
       "                0.12,\n",
       "                0.16,\n",
       "                0.19,\n",
       "                0.22,\n",
       "                0.25,\n",
       "                0.28,\n",
       "                0.31,\n",
       "                0.34,\n",
       "                0.38,\n",
       "                0.41,\n",
       "                0.44,\n",
       "                0.47,\n",
       "                0.5,\n",
       "                0.53,\n",
       "                0.56,\n",
       "                0.59,\n",
       "                0.62,\n",
       "                0.66,\n",
       "                0.69,\n",
       "                0.72,\n",
       "                0.75,\n",
       "                0.78,\n",
       "                0.81,\n",
       "                0.84,\n",
       "                0.88,\n",
       "                0.91,\n",
       "                0.94,\n",
       "                0.97,\n",
       "                1.0\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"value\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": true\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"formatter\": \"{value} \",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\",\n",
       "        \"#f6f5ec\"\n",
       "    ]\n",
       "};\n",
       "myChart_197dc6efd9a24e72b4b6fc4db7c0afc3.setOption(option_197dc6efd9a24e72b4b6fc4db7c0afc3);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.charts.line.Line at 0x1c1145450f0>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "la.chart.lift_curve(label, label_prob)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': '/nbextensions/echarts/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"75d8fb71ff3b41ca9488a93f1ebe3ce4\" style=\"width:800px;height:400px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts'], function(echarts) {\n",
       "        \n",
       "var myChart_75d8fb71ff3b41ca9488a93f1ebe3ce4 = echarts.init(document.getElementById('75d8fb71ff3b41ca9488a93f1ebe3ce4'), 'light', {renderer: 'canvas'});\n",
       "\n",
       "var option_75d8fb71ff3b41ca9488a93f1ebe3ce4 = {\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"PR Curve\",\n",
       "            \"left\": \"auto\",\n",
       "            \"top\": \"auto\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"95%\",\n",
       "        \"top\": \"center\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"save as image\"\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"restore\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"data view\"\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"series_id\": 444347,\n",
       "    \"tooltip\": {\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"PR\",\n",
       "            \"symbol\": \"emptyCircle\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"smooth\": true,\n",
       "            \"step\": false,\n",
       "            \"showSymbol\": true,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    0,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    0.0588,\n",
       "                    1.0\n",
       "                ],\n",
       "                [\n",
       "                    0.1176,\n",
       "                    1.0\n",
       "                ],\n",
       "                [\n",
       "                    0.1765,\n",
       "                    1.0\n",
       "                ],\n",
       "                [\n",
       "                    0.2353,\n",
       "                    1.0\n",
       "                ],\n",
       "                [\n",
       "                    0.2941,\n",
       "                    1.0\n",
       "                ],\n",
       "                [\n",
       "                    0.3529,\n",
       "                    1.0\n",
       "                ],\n",
       "                [\n",
       "                    0.4118,\n",
       "                    1.0\n",
       "                ],\n",
       "                [\n",
       "                    0.4118,\n",
       "                    0.875\n",
       "                ],\n",
       "                [\n",
       "                    0.4118,\n",
       "                    0.7778\n",
       "                ],\n",
       "                [\n",
       "                    0.4118,\n",
       "                    0.7\n",
       "                ],\n",
       "                [\n",
       "                    0.4706,\n",
       "                    0.7273\n",
       "                ],\n",
       "                [\n",
       "                    0.4706,\n",
       "                    0.6667\n",
       "                ],\n",
       "                [\n",
       "                    0.5294,\n",
       "                    0.6923\n",
       "                ],\n",
       "                [\n",
       "                    0.5294,\n",
       "                    0.6429\n",
       "                ],\n",
       "                [\n",
       "                    0.5294,\n",
       "                    0.6\n",
       "                ],\n",
       "                [\n",
       "                    0.5294,\n",
       "                    0.5625\n",
       "                ],\n",
       "                [\n",
       "                    0.5882,\n",
       "                    0.5882\n",
       "                ],\n",
       "                [\n",
       "                    0.6471,\n",
       "                    0.6111\n",
       "                ],\n",
       "                [\n",
       "                    0.6471,\n",
       "                    0.5789\n",
       "                ],\n",
       "                [\n",
       "                    0.6471,\n",
       "                    0.55\n",
       "                ],\n",
       "                [\n",
       "                    0.6471,\n",
       "                    0.5238\n",
       "                ],\n",
       "                [\n",
       "                    0.7059,\n",
       "                    0.5455\n",
       "                ],\n",
       "                [\n",
       "                    0.7059,\n",
       "                    0.5217\n",
       "                ],\n",
       "                [\n",
       "                    0.7647,\n",
       "                    0.5417\n",
       "                ],\n",
       "                [\n",
       "                    0.8235,\n",
       "                    0.56\n",
       "                ],\n",
       "                [\n",
       "                    0.8824,\n",
       "                    0.5769\n",
       "                ],\n",
       "                [\n",
       "                    0.9412,\n",
       "                    0.5926\n",
       "                ],\n",
       "                [\n",
       "                    0.9412,\n",
       "                    0.5714\n",
       "                ],\n",
       "                [\n",
       "                    0.9412,\n",
       "                    0.5517\n",
       "                ],\n",
       "                [\n",
       "                    0.9412,\n",
       "                    0.5333\n",
       "                ],\n",
       "                [\n",
       "                    1.0,\n",
       "                    0.5484\n",
       "                ],\n",
       "                [\n",
       "                    1.0,\n",
       "                    0.5312\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0.4\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 444347\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"PR\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": true,\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"top\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"animation\": true,\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"name\": \"recall\",\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"value\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": false\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                0,\n",
       "                0.0588,\n",
       "                0.1176,\n",
       "                0.1765,\n",
       "                0.2353,\n",
       "                0.2941,\n",
       "                0.3529,\n",
       "                0.4118,\n",
       "                0.4118,\n",
       "                0.4118,\n",
       "                0.4118,\n",
       "                0.4706,\n",
       "                0.4706,\n",
       "                0.5294,\n",
       "                0.5294,\n",
       "                0.5294,\n",
       "                0.5294,\n",
       "                0.5882,\n",
       "                0.6471,\n",
       "                0.6471,\n",
       "                0.6471,\n",
       "                0.6471,\n",
       "                0.7059,\n",
       "                0.7059,\n",
       "                0.7647,\n",
       "                0.8235,\n",
       "                0.8824,\n",
       "                0.9412,\n",
       "                0.9412,\n",
       "                0.9412,\n",
       "                0.9412,\n",
       "                1.0,\n",
       "                1.0\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"name\": \"precision\",\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"value\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": true\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"formatter\": \"{value} \",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\",\n",
       "        \"#f6f5ec\"\n",
       "    ]\n",
       "};\n",
       "myChart_75d8fb71ff3b41ca9488a93f1ebe3ce4.setOption(option_75d8fb71ff3b41ca9488a93f1ebe3ce4);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.charts.line.Line at 0x1c114545400>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "la.chart.pr_curve(label, label_prob)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts': '/nbextensions/echarts/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "    <div id=\"cc0161a1bc1944dcafe2f4450ea0d552\" style=\"width:800px;height:400px;\"></div>\n",
       "\n",
       "\n",
       "<script>\n",
       "    require(['echarts'], function(echarts) {\n",
       "        \n",
       "var myChart_cc0161a1bc1944dcafe2f4450ea0d552 = echarts.init(document.getElementById('cc0161a1bc1944dcafe2f4450ea0d552'), 'light', {renderer: 'canvas'});\n",
       "\n",
       "var option_cc0161a1bc1944dcafe2f4450ea0d552 = {\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"ROC Curve\",\n",
       "            \"left\": \"auto\",\n",
       "            \"top\": \"auto\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 18\n",
       "            },\n",
       "            \"subtextStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"left\": \"95%\",\n",
       "        \"top\": \"center\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"save as image\"\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"restore\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"data view\"\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"series_id\": 2697271,\n",
       "    \"tooltip\": {\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"backgroundColor\": \"rgba(50,50,50,0.7)\",\n",
       "        \"borderColor\": \"#333\",\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"ROC\",\n",
       "            \"symbol\": \"emptyCircle\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"smooth\": true,\n",
       "            \"step\": false,\n",
       "            \"showSymbol\": true,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    0,\n",
       "                    0\n",
       "                ],\n",
       "                [\n",
       "                    0.0,\n",
       "                    0.0588\n",
       "                ],\n",
       "                [\n",
       "                    0.0,\n",
       "                    0.1176\n",
       "                ],\n",
       "                [\n",
       "                    0.0,\n",
       "                    0.1765\n",
       "                ],\n",
       "                [\n",
       "                    0.0,\n",
       "                    0.2353\n",
       "                ],\n",
       "                [\n",
       "                    0.0,\n",
       "                    0.2941\n",
       "                ],\n",
       "                [\n",
       "                    0.0,\n",
       "                    0.3529\n",
       "                ],\n",
       "                [\n",
       "                    0.0,\n",
       "                    0.4118\n",
       "                ],\n",
       "                [\n",
       "                    0.0667,\n",
       "                    0.4118\n",
       "                ],\n",
       "                [\n",
       "                    0.1333,\n",
       "                    0.4118\n",
       "                ],\n",
       "                [\n",
       "                    0.2,\n",
       "                    0.4118\n",
       "                ],\n",
       "                [\n",
       "                    0.2,\n",
       "                    0.4706\n",
       "                ],\n",
       "                [\n",
       "                    0.2667,\n",
       "                    0.4706\n",
       "                ],\n",
       "                [\n",
       "                    0.2667,\n",
       "                    0.5294\n",
       "                ],\n",
       "                [\n",
       "                    0.3333,\n",
       "                    0.5294\n",
       "                ],\n",
       "                [\n",
       "                    0.4,\n",
       "                    0.5294\n",
       "                ],\n",
       "                [\n",
       "                    0.4667,\n",
       "                    0.5294\n",
       "                ],\n",
       "                [\n",
       "                    0.4667,\n",
       "                    0.5882\n",
       "                ],\n",
       "                [\n",
       "                    0.4667,\n",
       "                    0.6471\n",
       "                ],\n",
       "                [\n",
       "                    0.5333,\n",
       "                    0.6471\n",
       "                ],\n",
       "                [\n",
       "                    0.6,\n",
       "                    0.6471\n",
       "                ],\n",
       "                [\n",
       "                    0.6667,\n",
       "                    0.6471\n",
       "                ],\n",
       "                [\n",
       "                    0.6667,\n",
       "                    0.7059\n",
       "                ],\n",
       "                [\n",
       "                    0.7333,\n",
       "                    0.7059\n",
       "                ],\n",
       "                [\n",
       "                    0.7333,\n",
       "                    0.7647\n",
       "                ],\n",
       "                [\n",
       "                    0.7333,\n",
       "                    0.8235\n",
       "                ],\n",
       "                [\n",
       "                    0.7333,\n",
       "                    0.8824\n",
       "                ],\n",
       "                [\n",
       "                    0.7333,\n",
       "                    0.9412\n",
       "                ],\n",
       "                [\n",
       "                    0.8,\n",
       "                    0.9412\n",
       "                ],\n",
       "                [\n",
       "                    0.8667,\n",
       "                    0.9412\n",
       "                ],\n",
       "                [\n",
       "                    0.9333,\n",
       "                    0.9412\n",
       "                ],\n",
       "                [\n",
       "                    0.9333,\n",
       "                    1.0\n",
       "                ],\n",
       "                [\n",
       "                    1.0,\n",
       "                    1.0\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0.4\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 2697271\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"Random\",\n",
       "            \"symbol\": \"emptyCircle\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"smooth\": false,\n",
       "            \"step\": false,\n",
       "            \"showSymbol\": true,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    0,\n",
       "                    0\n",
       "                ],\n",
       "                [\n",
       "                    0.0,\n",
       "                    0.0\n",
       "                ],\n",
       "                [\n",
       "                    0.0,\n",
       "                    0.0\n",
       "                ],\n",
       "                [\n",
       "                    0.0,\n",
       "                    0.0\n",
       "                ],\n",
       "                [\n",
       "                    0.0,\n",
       "                    0.0\n",
       "                ],\n",
       "                [\n",
       "                    0.0,\n",
       "                    0.0\n",
       "                ],\n",
       "                [\n",
       "                    0.0,\n",
       "                    0.0\n",
       "                ],\n",
       "                [\n",
       "                    0.0,\n",
       "                    0.0\n",
       "                ],\n",
       "                [\n",
       "                    0.0667,\n",
       "                    0.0667\n",
       "                ],\n",
       "                [\n",
       "                    0.1333,\n",
       "                    0.1333\n",
       "                ],\n",
       "                [\n",
       "                    0.2,\n",
       "                    0.2\n",
       "                ],\n",
       "                [\n",
       "                    0.2,\n",
       "                    0.2\n",
       "                ],\n",
       "                [\n",
       "                    0.2667,\n",
       "                    0.2667\n",
       "                ],\n",
       "                [\n",
       "                    0.2667,\n",
       "                    0.2667\n",
       "                ],\n",
       "                [\n",
       "                    0.3333,\n",
       "                    0.3333\n",
       "                ],\n",
       "                [\n",
       "                    0.4,\n",
       "                    0.4\n",
       "                ],\n",
       "                [\n",
       "                    0.4667,\n",
       "                    0.4667\n",
       "                ],\n",
       "                [\n",
       "                    0.4667,\n",
       "                    0.4667\n",
       "                ],\n",
       "                [\n",
       "                    0.4667,\n",
       "                    0.4667\n",
       "                ],\n",
       "                [\n",
       "                    0.5333,\n",
       "                    0.5333\n",
       "                ],\n",
       "                [\n",
       "                    0.6,\n",
       "                    0.6\n",
       "                ],\n",
       "                [\n",
       "                    0.6667,\n",
       "                    0.6667\n",
       "                ],\n",
       "                [\n",
       "                    0.6667,\n",
       "                    0.6667\n",
       "                ],\n",
       "                [\n",
       "                    0.7333,\n",
       "                    0.7333\n",
       "                ],\n",
       "                [\n",
       "                    0.7333,\n",
       "                    0.7333\n",
       "                ],\n",
       "                [\n",
       "                    0.7333,\n",
       "                    0.7333\n",
       "                ],\n",
       "                [\n",
       "                    0.7333,\n",
       "                    0.7333\n",
       "                ],\n",
       "                [\n",
       "                    0.7333,\n",
       "                    0.7333\n",
       "                ],\n",
       "                [\n",
       "                    0.8,\n",
       "                    0.8\n",
       "                ],\n",
       "                [\n",
       "                    0.8667,\n",
       "                    0.8667\n",
       "                ],\n",
       "                [\n",
       "                    0.9333,\n",
       "                    0.9333\n",
       "                ],\n",
       "                [\n",
       "                    0.9333,\n",
       "                    0.9333\n",
       "                ],\n",
       "                [\n",
       "                    1.0,\n",
       "                    1.0\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"normal\": {\n",
       "                    \"show\": false,\n",
       "                    \"position\": \"top\",\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                },\n",
       "                \"emphasis\": {\n",
       "                    \"show\": true,\n",
       "                    \"textStyle\": {\n",
       "                        \"fontSize\": 12\n",
       "                    }\n",
       "                }\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"data\": []\n",
       "            },\n",
       "            \"seriesId\": 2697271\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"ROC\",\n",
       "                \"Random\"\n",
       "            ],\n",
       "            \"selectedMode\": \"multiple\",\n",
       "            \"show\": true,\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"top\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 12\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"animation\": true,\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"name\": \"FPR\",\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"value\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": false\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                0,\n",
       "                0.0,\n",
       "                0.0,\n",
       "                0.0,\n",
       "                0.0,\n",
       "                0.0,\n",
       "                0.0,\n",
       "                0.0,\n",
       "                0.0667,\n",
       "                0.1333,\n",
       "                0.2,\n",
       "                0.2,\n",
       "                0.2667,\n",
       "                0.2667,\n",
       "                0.3333,\n",
       "                0.4,\n",
       "                0.4667,\n",
       "                0.4667,\n",
       "                0.4667,\n",
       "                0.5333,\n",
       "                0.6,\n",
       "                0.6667,\n",
       "                0.6667,\n",
       "                0.7333,\n",
       "                0.7333,\n",
       "                0.7333,\n",
       "                0.7333,\n",
       "                0.7333,\n",
       "                0.8,\n",
       "                0.8667,\n",
       "                0.9333,\n",
       "                0.9333,\n",
       "                1.0\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"name\": \"TPR\",\n",
       "            \"show\": true,\n",
       "            \"nameLocation\": \"middle\",\n",
       "            \"nameGap\": 25,\n",
       "            \"nameTextStyle\": {\n",
       "                \"fontSize\": 14\n",
       "            },\n",
       "            \"axisTick\": {\n",
       "                \"alignWithLabel\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"boundaryGap\": true,\n",
       "            \"type\": \"value\",\n",
       "            \"splitLine\": {\n",
       "                \"show\": true\n",
       "            },\n",
       "            \"axisLine\": {\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1\n",
       "                }\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"interval\": \"auto\",\n",
       "                \"formatter\": \"{value} \",\n",
       "                \"rotate\": 0,\n",
       "                \"margin\": 8,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 12\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\",\n",
       "        \"#f6f5ec\"\n",
       "    ]\n",
       "};\n",
       "myChart_cc0161a1bc1944dcafe2f4450ea0d552.setOption(option_cc0161a1bc1944dcafe2f4450ea0d552);\n",
       "\n",
       "    });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<pyecharts.charts.line.Line at 0x1c102fa1eb8>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "la.chart.roc_curve(label, label_prob)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
